package com.zzq.mapper;

import com.zzq.pojo.Bidder;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface BidderMapper {

    @Select("select * from bidder where username=#{username}")
    Bidder findByBidderName(String username);

    @Insert("insert into bidder(username,password,name,contact_email,address,registration_date) values(#{username},#{password},#{companyName},#{email},#{address},now())")
    void add(String username, String password,String companyName,String email,String address);

    @Select("select * from bidder")
    List<Bidder> list();

    @Delete("delete from bidder where id=#{id}")
    void deleteBidder(int id);

    @Update("update bidder set name=#{name},contact_email=#{contactEmail},address=#{address} where id=#{id}")
    void enitBidder(Bidder bidder);

}
